You can extend volumes on both basic
and dynamic disks using either Disk Management or DiskPart. This is
handy if you create a partition that’s too small and you want to extend
it so that you have more space for programs and data. In extending a
volume, you convert areas of unallocated space and add them to the
existing volume. For spanned volumes on dynamic disks, the space can
come from any available dynamic disk, not only those on which the volume
was originally created. Thus, you can combine areas of free space on
multiple dynamic disks and use those areas to increase the size of an
existing volume.
Before you try to extend a volume, be aware of several limitations.
First, you can extend simple and spanned volumes only if they are
formatted and the file system is NTFS (and in some instances, ReFS).
You can’t extend striped volumes. You can’t extend volumes that aren’t
formatted or that are formatted with FAT, FAT32, or exFAT. You can
extend NTFS (and in some instances, ReFS) volumes on both basic and
dynamic disks using either Disk Management or DiskPart.
Using Disk Management, you can extend a simple or spanned volume by following these steps:
-
Open Disk Management. Press and hold or right-click the volume that
you want to extend, and then select Extend Volume. This option is
available only if the volume meets the previously discussed criteria and
free space is available on one or more of the system’s dynamic disks.
-
In the Extend Volume Wizard, read the introductory message and then tap or click Next.
-
On the Select Disks page, shown in Figure 24,
select the disk or disks from which you want to allocate free space.
Any disks currently being used by the volume are selected automatically.
By default, all remaining free space on those disks will be selected
for use.
-
With dynamic disks, you can specify the additional space that you
want to use on other disks. Select the disk and then tap or click Add to
add the disk to the Selected list box. In the Selected list box, select
each disk that you want to use, and in the Select The Amount Of Space
In MB list box, specify the amount of unallocated space to use on the
selected disk.
-
Tap or click Next, confirm your options, and then tap or click Finish.
By using DiskPart, you can extend partitions using the command line. To extend a partition, invoke DiskPart by typing diskpart at the command prompt. List the disks on the computer by typing list disk. After you check the free space of each disk, select the disk by typing select disk N
, where N is the disk you want to work with. Next, list the partitions on the selected disk by typing list partition. Select the last partition in the list by typing select partition N
, where N is the disk you want to work with.
Now that you’ve selected a partition, you can extend it. To extend the partition to the end of the disk, type extend. To extend the partition by a set amount, type extend size= N
, where N is the amount of space to add in megabytes. For example, if you want to add 90 GBs to the partition, type extend size=90000.
Example 2
shows an actual DiskPart session in which a disk is extended. You can
use this as an example to help you understand the process of extending disks. Here, disk 2 has 119 GBs of free space, and its primary partition is extended so that it fills the disk.
Example 2. Extending disks
C:\> diskpart
Microsoft DiskPart version 6.2.9200
Copyright (C) 1999-2012 Microsoft Corporation.
On computer: CORPSVR02
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- -------- ----- ----- --- ---
Disk 0 Online 1560 GB 504 GB * *
Disk 1 Online 1290 GB 0 B
Disk 2 Online 370 GB 119 GB
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> list partition
Partition ### Type Size Offset
------------- --------- ------- -------
Partition 1 Primary 370 GB 32 KB
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> extend
DiskPart successfully extended the partition.
DISKPART> exit
Leaving DiskPart...
C:\>
To extend a partition on a dynamic disk to free space on another disk, you use the following syntax:
extend size=X
disk=Y
Here, size=X sets the amount of space to use in megabytes and disk=Y
sets the number of the disk from which to allocate the space. Following
this, you could allocate 50 GBs of free space from disk 0 to the
selected disk in the previous example (disk 2) using the following
command:
extend size=50000 disk=0
You can shrink volumes on both basic
and dynamic disks using either Disk Management or DiskPart. This is
handy if you create a partition that’s too large and you want to shrink
it so that you have more space for other partitions. In shrinking a
volume, you convert areas of allocated but unused space to free space by
removing them from an existing volume.
As with extending volumes,
several limitations apply to shrinking volumes. First, you can shrink
simple and spanned volumes only if they are formatted and the file
system is NTFS. You can’t shrink striped volumes. You can’t shrink
volumes that are formatted with FAT, FAT32, exFAT, or ReFS.
However, you can shrink volumes that have not been formatted. If a
volume is heavily fragmented, you might have to defragment the volume to
free up additional space before shrinking.
Using Disk Management, you can shrink a simple or spanned volume by following these steps:
-
Open Disk Management. Press and hold or right-click the volume that
you want to shrink, and then select Shrink Volume. This option is
available only if the volume meets the previously discussed criteria.
-
In the field provided in the Shrink dialog box shown in Figure 25, enter the amount of space to shrink. The Shrink dialog box provides the following information:
-
Total Size Before Shrink In MB Lists the total capacity of the volume in megabytes. This is the formatted size of the volume.
-
Size Of Available Shrink Space In MB
Lists the maximum amount by which the volume can be shrunk. This
doesn’t represent the total amount of free space on the volume; rather,
it represents the amount of space that can be removed, not including any
data reserved for the master file table, volume snapshots, page files,
and temporary files.
-
Enter The Amount Of Space To Shrink In MB
Lists the total amount of space that will be removed from the volume.
The initial value defaults to the maximum amount of space that can be
removed from the volume. For optimal drive performance, you’ll want to
ensure that the drive has at least 10 percent of free space after the
shrink operation.
-
Total Size After Shrink In MB
Lists what the total capacity of the volume in megabytes will be after
the shrink. This is the new formatted size of the volume.
-
Tap or click Shrink to shrink the volume.
By using DiskPart, you can shrink partitions using the command line. To shrink an NTFS-formatted partition, invoke DiskPart by typing diskpart at the command prompt. List the disks on the computer by typing list disk. After you check the free space of each disk, select the disk by typing select disk N
, where N is the disk you want to work with. Next, list the partitions on the selected disk by typing list partition. Select the last partition in the list by typing select partition N
, where N is the disk you want to work with.
Now that you’ve selected a partition, you can shrink it. To determine
the maximum amount of space by which you can shrink the disk, type shrink querymax. To shrink the partition by the maximum amount, type shrink. To shrink the partition by a set amount, type shrink desired= N
, where N is the amount of space to remove in megabytes. For example, if you want to remove 225 GBs from the partition, type shrink desired=225000.
Example 3
shows an actual DiskPart session in which you shrink a disk. You can
use this as an example to help you understand the process of shrinking disks. Here you determine that there are 40 GBs of space available for shrinking on the selected partition and then shrink the partition by 32 GBs.
Example 3. Shrinking disks
C:\> diskpart
Microsoft DiskPart version 6.2.9200
Copyright (C) 1999-2012 Microsoft Corporation.
On computer: CORPSVR02
DISKPART> list disk
Disk ### Status Size Free Dyn Gpt
-------- -------- ----- ----- --- ---
Disk 0 Online 1560 GB 504 GB * *
Disk 1 Online 1290 GB 0 B
Disk 2 Online 489 GB 0 B
DISKPART> select disk 2
Disk 2 is now the selected disk.
DISKPART> list partition
Partition ### Type Size Offset
------------- --------- ------- -------
Partition 1 Primary 489 GB 32 KB
DISKPART> select partition 1
Partition 1 is now the selected partition.
DISKPART> shrink querymax
The maximum number of reclaimable bytes is: 40 GB
DISKPART> shrink desired=32000
DiskPart successfully shrunk the partition by: 32000 MB
DISKPART> exit
Leaving DiskPart...
C:\>
4.7 Deleting a partition, logical drive, or volume
Deleting a partition, logical drive, or volume removes the associated
file system and all associated data. When you delete a logical drive,
the logical drive is removed from the associated extended partition and
its space is marked as free. When you delete a partition or volume, the
entire partition or volume is deleted and its space is marked as
Unallocated. If you want to delete an extended partition that contains
logical drives, however, you must delete the logical drives before
trying to delete the extended partition.
In Disk Management, you can delete a partition, logical drive, or
volume by pressing and holding or right-clicking it and then choosing
Delete Partition, Delete Logical Drive, or Delete Volume, as
appropriate. When prompted to confirm the action, tap or click Yes.